package com.elec.controller.front;

import com.elec.domain.R;
import com.elec.domain.entity.User;
import com.elec.service.UserService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author yu
 * @date 2024/7/7
 */
@RestController
@RequestMapping("front/user")
public class UserInfoController {
    @Resource
    private UserService userService;
    @GetMapping("getMyInfo")
    public R getMyInfo(){
        return userService.getMyInfo();
    }
    @PutMapping("updateMyInfo")
    public R updateMyInfo(@RequestBody User user){
        return userService.updateMyInfo(user);
    }
}
